package org.davidliebman.android.awesomecube;

public class MeshPartPlaneX extends MeshPart {

	public MeshPartPlaneX (int textureID, boolean reversed, float moveX, float moveY, float moveZ, int mShape) {
		super(textureID);
		
		this.mShape = mShape;
		this.setDistanceVars();
		this.setupArrays(moveX, moveY, moveZ, reversed);
		

	}
	
	public MeshPartPlaneX (int textureID, boolean reversed, float moveX, float moveY, float moveZ) {
		super(textureID);
		
		
		this.setDistanceVars();
		this.setupArrays(moveX, moveY, moveZ, reversed);
		

	}
	
	public MeshPartPlaneX (int textureID) {
		this(textureID, false, 0f,0f,0f);
		
		
		
	}
	
	public void setupArrays(float moveX, float moveY, float moveZ, boolean reversed) {
		this.mReverseWinding = reversed;
		
		this.mPoints.clear();
		this.add(new PointXYZ ( moveX - this.mDistanceCenter , moveY - this.mDistanceLeft, moveZ - this.mDistanceBot ), 1.0f, 1.0f);//0
		this.add(new PointXYZ ( moveX - this.mDistanceCenter , moveY + this.mDistanceRight, moveZ - this.mDistanceBot ), 1.0f, 0.0f); //1
		this.add(new PointXYZ ( moveX - this.mDistanceCenter , moveY - this.mDistanceLeft, moveZ + this.mDistanceTop ), 0.0f, 1.0f ); //2
		this.add(new PointXYZ ( moveX - this.mDistanceCenter , moveY + this.mDistanceRight, moveZ + this.mDistanceTop ), 0.0f, 0.0f);  //3
	

		
		
		this.mIndex.clear();
		this.addIndex((short)0);
		this.addIndex((short)2);
		this.addIndex((short)1);
		this.addIndex((short)2);
		this.addIndex((short)3);
		this.addIndex((short)1);
		
	}
}
